import { NgModule, ErrorHandler } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { IonicApp, IonicModule, IonicErrorHandler } from 'ionic-angular';
import { MyApp } from './app.component';
import { IonicStorageModule} from "@ionic/storage";
import { ReactiveFormsModule } from '@angular/forms';
import {CustomFormsModule} from "ng2-validation";
import { HomePage } from '../system/pages/home/home';
import { TabsPage } from '../system/pages/tabs/tabs';

import { StatusBar } from '@ionic-native/status-bar';
import { SplashScreen } from '@ionic-native/splash-screen';
import {LoginPage} from "../system/pages/login/login";
import {SettingPage} from "../system/pages/setting/setting";
import {BackButtonService} from "../system/services/backButton.service";
import {HttpClientModule} from "@angular/common/http";
import {AppService} from "../system/services/app.service";
import {ComponentsModule} from "../system/components/components.module";
import {Device} from "@ionic-native/device";
import {AppVersion} from "@ionic-native/app-version";
import {File} from "@ionic-native/file";
import {FileOpener} from "@ionic-native/file-opener";
import {FileTransfer,FileTransferObject} from "@ionic-native/file-transfer";
import {JPush} from "@jiguang-ionic/jpush";
import {UserInfoService} from "../system/services/userInfo.service";
import {LoadingService} from "../system/services/loading.service";
import {Camera} from "@ionic-native/camera";
import {UploadService} from "../system/services/upload.service";
import {BrowserAnimationsModule} from "@angular/platform-browser/animations";
import {ToastrModule} from "ngx-toastr";
import {SQLite} from "@ionic-native/sqlite";
import {AppInitService} from "../system/services/appInit.service";
import {MessageService} from "../system/services/message.service";
import {MultiPickerModule} from "ion-multi-picker";
import { CityDataProvider } from '../system/providers/city-data/city-data';
import {SysDictService} from "../system/services/sysDict.service";
import {OrgService} from "../system/services/org.service";
import {IdCardValidator} from "../system/validators/id-card.derective";
import {HTTP} from "@ionic-native/http";
import {SqliteService} from "../system/services/sqlite.service";


@NgModule({
  declarations: [
    MyApp,
    LoginPage,
    HomePage,
    SettingPage,
    TabsPage,
    IdCardValidator,
  ],
  imports: [
    BrowserModule,
    HttpClientModule,
    ReactiveFormsModule,
    CustomFormsModule,
    IonicModule.forRoot(MyApp),
    IonicStorageModule.forRoot(),
    ComponentsModule,
    MultiPickerModule,
    BrowserAnimationsModule, // required animations module
    ToastrModule.forRoot({
      maxOpened:1,
      autoDismiss:true,
      timeOut: 1500,
      positionClass: 'toast-bottom-center',
      preventDuplicates: true,
    }), // ToastrModule added
  ],
  bootstrap: [IonicApp],
  entryComponents: [
    MyApp,
    LoginPage,
    SettingPage,
    HomePage,
    TabsPage
  ],
  providers: [
    StatusBar,
    SplashScreen,
    AppService,
    UserInfoService,
    BackButtonService,
    LoadingService,
    UploadService,
    AppInitService,
    MessageService,
    SysDictService,
    OrgService,
    Device,
    AppVersion,
    File,
    SqliteService,
    FileOpener,
    FileTransfer,
    FileTransferObject,
    JPush,
    Camera,
    SQLite,
    HTTP,
    ,
    //ImagePicker,
    {provide: ErrorHandler, useClass: IonicErrorHandler},
    CityDataProvider
  ]
})
export class AppModule {}
